/**
 * Created by ceshi-room on 2017/12/8.
 */
import ajax from './ajax';
import API from './apiuri';
const fileApi = API.fileApi;

export default {
  addFile (data) {
    return ajax({
      url: fileApi.addfile,
      data: data,
      method: 'POST'
    });

  },
  getFileTree (filePath) {
    return ajax({
      url: fileApi.filetree + '?path=' + filePath,
      method: 'GET'
    });
  },
  saveFile (data) {
    return ajax({
      url: fileApi.savefile,
      data: data,
      method: 'POST'
    });
  },
  deleteFile (data) {
    return ajax({
      url: fileApi.deletefile + '?href=' + data,
      method: 'delete'
    });
  }
}
